﻿using System;
using Mono.Cecil;
using TK_CSLua.ILAnalyze;

namespace CSLua
{
	// Token: 0x02000010 RID: 16
	public class BuildFilePhase
	{
		// Token: 0x06000083 RID: 131 RVA: 0x0000486F File Offset: 0x00002A6F
		public BuildFilePhase(LuaType luaType, CodeWriter builder)
		{
			this.luaType = luaType;
			this.mainTypeDef = luaType.ILTypeDef;
			this.writer = builder;
			this.buildContext = new BuildFileContext(luaType, builder);
		}

		// Token: 0x06000084 RID: 132 RVA: 0x0000489E File Offset: 0x00002A9E
		public BuildFilePhase(BuildFilePhase ctx)
		{
			this.mainTypeDef = ctx.mainTypeDef;
			this.writer = ctx.writer;
			this.buildContext = ctx.buildContext;
		}

		// Token: 0x06000085 RID: 133 RVA: 0x000048CA File Offset: 0x00002ACA
		public static string toIdentifier(string p)
		{
			return BuilderUtils.toIdentifier(p);
		}

		// Token: 0x06000086 RID: 134 RVA: 0x000022C5 File Offset: 0x000004C5
		public static void Assert(bool b, string msg = null)
		{
			if (!b)
			{
				throw new Exception((msg != null) ? msg : "Assert fail!");
			}
		}

		// Token: 0x04000035 RID: 53
		public BuildFileContext buildContext;

		// Token: 0x04000036 RID: 54
		public TypeDefinition mainTypeDef;

		// Token: 0x04000037 RID: 55
		public LuaType luaType;

		// Token: 0x04000038 RID: 56
		public CodeWriter writer;
	}
}
